package com.unidt.www.module.bpm.dal.mysql.definition;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.unidt.www.framework.mybatis.core.mapper.BaseMapperX;
import com.unidt.www.module.bpm.dal.dataobject.definition.ActRuActTimeDo;
import com.unidt.www.module.bpm.vo.TaskStatisticsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ActRuActTimeMapper extends BaseMapperX<ActRuActTimeDo> {

    default ActRuActTimeDo getByTaskId(String taskId){

        LambdaQueryWrapper<ActRuActTimeDo> lambdaQueryWrapper =
                new LambdaQueryWrapper<>();

        lambdaQueryWrapper.eq(ActRuActTimeDo::getTaskId,taskId);
        lambdaQueryWrapper.eq(ActRuActTimeDo::getDeleted,false);
        return this.selectOne(lambdaQueryWrapper);

    };

    /**
     * 功能描述: 我的逾期统计
     * @author sk
     * @date 2023/2/10
     * @param assignee
     * @param startTime
     * @param endTime
     * @return java.util.List<com.unidt.www.module.bpm.vo.TaskStatisticsVo>
     */

    List<TaskStatisticsVo> getMyTaskTimeOut(@Param(value = "assignee") Long assignee, @Param(value = "startTime") Date startTime, @Param(value = "endTime") Date endTime);


    /**
     * 功能描述: 部门逾期统计
     * @author sk
     * @date 2023/2/10
     * @param deptId
     * @param startTime
     * @param endTime
     * @return java.util.List<com.unidt.www.module.bpm.vo.TaskStatisticsVo>
     */

    List<TaskStatisticsVo> getMyDeptTaskTimeOut(@Param(value = "deptId") Long deptId, @Param(value = "startTime") Date startTime, @Param(value = "endTime") Date endTime);
}
